<template>
  <el-form :model="examData" label-position="left" label-width="100px">

    <el-form-item label="启用摄像头">
      <el-switch v-model="examData.openCamera" active-color="#13ce66" inactive-color="#ff4949">
      </el-switch>
    </el-form-item>

    <el-form-item label="禁止网页切换">
      <el-switch v-model="webChange" active-color="#13ce66" inactive-color="#ff4949" @change="changeStatus">
      </el-switch>
      <p v-if="webChange">学员切换页面超过<el-input-number :min="0" v-model="examData.openWebChange" width="50px"></el-input-number> 次后将被强制交卷，切屏判定为：离开本页面7s算作一次 
      </p>
    </el-form-item>

    <el-form-item label="千人千卷">
      <el-switch v-model="examData.difPaper" active-color="#13ce66" inactive-color="#ff4949">
      </el-switch>
      <el-alert v-if="examData.difPaper" title="开启后，每个考生将看到不同的试卷，尽可能防止考生作弊，关闭后，使用统一试卷进行考试" type="warning" />
    </el-form-item>

    <el-form-item label="禁止复制试题">
      <el-switch v-model="examData.copyQu" active-color="#13ce66" inactive-color="#ff4949">
      </el-switch>

      <el-alert v-if="examData.copyQu" title="答题过程中，是否可以复制试题" type="warning" />

    </el-form-item>

    <el-form-item label="禁止粘贴内容">
      <el-switch v-model="examData.stick" active-color="#13ce66" inactive-color="#ff4949">
      </el-switch>

      <el-alert v-if="examData.stick" title="答题过程中，是否可以粘贴内容" type="warning" />

    </el-form-item>

  </el-form>
</template>
<script>
export default {
  name: 'ExamConf',
  props:{
    examData:{
      type: Object,
      default: null,
    }
  },
  data(){
    return{
      webChange: false
    }
    
  },
  created(){
    this.webChange = this.examData.openWebChange > 0 ? true : false;
  },
  methods:{
    changeStatus(){
      if(!this.webChange){
        this.examData.openWebChange = 0
      }
    }
  }
  
}
</script>